<script setup>
// 1：导入
import { ref } from 'vue'
// 2：调用
// 3:使用：html不需要写.value,但是js一定要写.value
const num = ref(0)
const add = () => {
  console.log(num)
  num.value++
}
const obj = ref({
  age: 18
})
const addAge = () => {
  console.log(obj)
  obj.value.age++
}
</script>

<template>
  <div class="page">
    <div>{{ num }}</div>
    <button @click="add">点击++</button>
    <hr />
    <div>{{ obj.age }}</div>
    <button @click="addAge">点击age++</button>
  </div>
</template>

<style scoped></style>
